widget: Implement create_path for widgets with non-container parent
authorTimm Bäder <mail@baedert.org>
Fri, 18 Nov 2016 09:02:50 +0000 (10:02 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 7 Jan 2017 16:19:26 +0000 (17:19 +0100)
gtk/gtkwidget.c

index 1de5d2fa667855a5be9d05bd4ca2748cb442eadc..a3e12931d47249b310b338a20c2e1f4f395a304a 100644 (file)
@@ -14565,8 +14565,14 @@ _gtk_widget_create_path (GtkWidget *widget)
 
   parent = widget->priv->parent;
 
-  if (parent)
+  if (parent && GTK_IS_CONTAINER (parent))
     return gtk_container_get_path_for_child (GTK_CONTAINER (parent), widget);
+  else if (parent)
+    {
+      GtkWidgetPath *path = _gtk_widget_create_path (parent);
+      gtk_widget_path_append_for_widget (path, widget);
+      return path;
+    }
   else
     {
       /* Widget is either toplevel or unparented, treat both